You are not logged in Log in Join
You are here: Home » Members » isalsberg » Zope stuff for Mac OS X » HowTo Start Zope Automatically in Mac OS X 10.4.x

Log in
Name

Password

 

HowTo Start Zope Automatically in Mac OS X 10.4.x

 

Created by isalsberg . Last modified 2006-07-11 16:51:26.

This will show you the steps to start Zope at booting time, using the StartupItems directory with Mac OS X 10.4

To Startup Zope at boot time using Mac OS X StartupItems, the tricky thing is to change the effective-user in your instance configuration file.

All the steps require an administrative account capable to execute the sudo command. I am using Mac OS X 10.4.7

These are the Steps:

1. Go to /Library/StartupItems


   imac-g5:~ isaac$ cd /Library/StartupItems

 

2. As system administrator, create the Folder Zope under /Library/StartupItems/


   imac-g5:/Library/StartupItems isaac$ sudo mkdir Zope

 

3. Once the Folder  has been created, the permissions should look like:


   imac-g5:/Library/StartupItems isaac$ ls -l

   total 0

   drwxr-xr-x   5 root  wheel  170 Jul  7 17:50 Zope

 

4. Change to the recently created directory "/Library/StartupItems/Zope"


   imac-g5:/Library/StartupItems isaac$ cd Zope/

 

5. As administrator, create a startup script named Zope, with 755 permissions and with this content (Do NOT FORGET to change “/usr/local/Zope_Instance_280” for YOUR instance PATH):


#!/bin/sh

##
# Zope HTTP Server
##

. /etc/rc.common
log=/var/tmp/zopectl.log
echo "=============================================" >> $log
date >> $log

StartService ()
{
    ConsoleMessage "Starting Zope Instance"
    /usr/local/Zope_Instance_280/bin/zopectl start >> $log 2>&1
}

StopService ()
{
    ConsoleMessage "Stopping Zope Instance"
    /usr/local/Zope_Instance_280/bin/zopectl stop >> $log 2>&1
}

RestartService ()
{
    ConsoleMessage "Restarting Zope Instance"
    /usr/local/Zope_Instance_280/bin/zopectl restart >> $log 2>&1
}

RunService "$1"

# End of startup script

 

6. In the same Zope folder, create the file "StartupParameters.plist" using the output from the more command.

Make the file with permissions 644:


   imac-g5:/Library/StartupItems/Zope isaac$ more StartupParameters.plist


{
    Description = "Zope application server";
    Provides = ("Zope Server");
    Requires = ("Disks","Network","Resolver");
    OrderPreference = "Last";
    Messages =
    {
       start = "Starting Zope Server";
       stop = "Stopping Zope Server";
       restart = "Restarting Zope Server";
    };
}

 

7. Once you have created the two files, the /Library/StartupItems/Zope folder should look like:


   imac-g5:/Library/StartupItems/Zope isaac$ ls -l

   total 24

   -rw-r--r--   1 root  wheel   320 Jul  7 13:54   StartupParameters.plist

   -rwxr-xr-x   1 root  wheel  1546 Jul  7 17:50 Zope

 

8. Last but not least, go to the etc folder where your Zope instance was created and change in the "zope.conf" file the effective-user directive, otherwise the startup script will NOT work. By default, this directive is unset.

In this example, I wrote "isaac" as username:


# Default: unset
#
# Example:
#
#   effective-user chrism
effective-user isaac
##############################################

 

9. Now, reboot your MAC and your Zope instance should automatically startup.

 

That's it.

Isaac Salsberg

Comment

Discussion icon coment on step #8

Posted by: deesto at 2007-08-15

In zope.conf for Plone 2.5.3 for Mac OS X, "effective-user" is enabled by default and set to the "plone" user.